import dialogs from '@/dialogs'
import useAppStore from '@/store/modules/app'

const AppModal = () => {
  const { dialogConfig } = useAppStore()

  const DialogComponent = dialogs.find((item) => item.dialog === dialogConfig.dialog)?.component

  return DialogComponent ? <DialogComponent {...dialogConfig.params} /> : null
}

export default AppModal
